package com.tiamo.traders.controller;

import com.tiamo.traders.entity.Certification;
import com.tiamo.traders.service.CertificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/tiamo/Certification")
public class CertificationController{
    @Autowired
    CertificationService certificationService;

    @RequestMapping("/add")
    public int add(Certification certification) {
        return certificationService.add(certification);
    }

    @RequestMapping("/update")
    public int update(Certification certification) {
        return certificationService.update(certification);
    }

    @RequestMapping("/delete")
    public int delete(Certification certification) {
        return certificationService.delete(certification);
    }

    @RequestMapping("/findAll")
    public List<Certification> findAll(Certification certification) {
        return certificationService.findAll(certification);
    }

    @RequestMapping("/findById")
    public Certification findById(Certification certification) {
        return certificationService.findById(certification);
    }

    @RequestMapping("/getCount")
    public int getCount(Certification certification) {
        return certificationService.getCount(certification);
    }
}
